<layout name="layout" />
<if condition="$catid neq 0">
 <div class="main-title">
	  <div class="fr">
		<!--   <form id="formSearch">
			<input type="text" name="keyword"  class="input input-200" placeholder="标题搜索" value="{$keyword}">
			<input type="submit" value="搜索" class="btn btn-main">
		  </form>-->
	  </div>
 </div>
  <div class="main-content">
	 <div class="main-content-title">
	    {:URL('增加','add',array('icon'=>'add','parame'=>array('catid'=>$_GET['catid'])))}
	    {:URL('排序','##',array('icon'=>'listorder','class'=>'listorder'))}
	 
		<ul class="ul-list-row">
		     <volist name="sortList" id="vo">
		    	 <li class="tac"><a href="{:U('Ads/lis',array('sortid'=>$vo['sort_id']))}">{$vo.sort_title}</a></li>
		     </volist>
		 
		 </ul>
		 
	  </div>
	  <div class="main-content-body">
	   <form action="" method="post" id="form001">	  
		  <table class="table-list" >
		  <thead>
			<tr>
			  <td width="5%">序列号</td>
			  <td width="5%">ID</td>
			  <td width="45%">标题</td>
			  <td width="10%">浏览量</td>
			  <td width="10%">更新时间</td>			 
			  <td width="15%">操作</td>
			  <td></td>
			</tr>
		</thead>
		<tbody> 
		  <volist  name="dataList" id="vo">
			<tr>
			   <td><input type="text" name='listorder[{$vo.id}]' value="{$vo.listorder}" class="w50"></td>
			   <td>{$vo.id}</td>
			   <td>{$vo.title}{$vo.image|hasImage}{$vo.status|markStatus}</td>
			   <td>{$vo.views}</td>
			   <td>{$vo.update_time|toDate}</td>
			   <td>
			   {:URL('编辑','edit',array('parame'=>array('primarykey'=>$vo['id'],'catid'=>$vo['catid']),'icon'=>'edit'))}
			   {:URL('删除','del',array('parame'=>array('primarykey'=>$vo['id'],'catid'=>$vo['catid']),'icon'=>'del'))}
			
			   </td>
			   <td></td>
			</tr>
		</volist> 
		<notpresent name="dataList"> <tr><td colspan="10" class="text-warning tac">没有数据</td></tr></notpresent>
		</tbody>
		  </table>	
	  </form>
	 </div>
	   <script>
	    $(function(){
	    	$('.listorder').on('click',function(){
	    		 var apiUrl = "{:U('content/listorder',array('catid'=>$catid))}";
	    		   
	    		   changeListorder(apiUrl,'form001');
	    		   return false;
	    	});
	    	$('.open-icon').on('click',function(){
	    		var id = $(this).parent('a').attr('dataid');
	    		
	    		var apiUrl = "{:U('change_status')}";
	    		changeStatus(apiUrl,{usable: 1,id: id});
	    		 return false;
	    		
	    	});
	    	$('.close-icon').on('click',function(){
	    		var id = $(this).parent('a').attr('dataid');
	    		
	    		var apiUrl = "{:U('change_status')}";
	    		changeStatus(apiUrl,{usable: 0,id: id});
	    		 return false;
	    		
	    	});
	    	
	    })
	    
	    
	  </script>
	</div>	
	</if>